#include "Bishop.hpp"
#include "CriticalException.hpp"
#include "Cell.hpp"

Bishop::Bishop(Chess::Color color, const Position& pos)
	: Piece(color, Piece::BISHOP, pos)
{}

Bishop::~Bishop()
{}

list<Position*>	Bishop::getPossibleCases() const
{
	if (this->isOut())
		throw new CriticalException("Bishop :: getPossibleCases : Trying to get possible cases while piece is out !");
	
	Position current = this->getCell()->getPosition();
	list<Position*> valables;
	
	Piece::up_left_diagonal(*this, valables);
	Piece::up_right_diagonal(*this, valables);
	Piece::down_left_diagonal(*this, valables);
	Piece::down_right_diagonal(*this, valables);
	
	return valables;
}
		
